//package com.world.rickcloudendpoint.api.controller;
//
//import com.world.rickcloudendpoint.common.enums.Cmd;
//import com.world.rickcloudendpoint.common.enums.Topic;
//import com.world.rickcloudendpoint.service.net.websocket.TopicSubscribeManager;
//import com.world.rickcloudendpoint.common.utils.DateUtils;
//import io.swagger.annotations.ApiOperation;
//import lombok.extern.log4j.Log4j2;
//import org.springframework.scheduling.annotation.Scheduled;
//import org.springframework.stereotype.Component;
//
//import java.util.*;
//
///**
// * @description:
// * @author: jlsong
// * @date: 2021/12/12 20:55:35
// * @version: 1.0
// */
//@Component
//@Log4j2
//public class SocketController {
//
//    final TopicSubscribeManager manager;
//
//    public SocketController(TopicSubscribeManager manager) {
//        this.manager = manager;
//    }
//
//
//    @ApiOperation(value = "推送XX消息到前台", notes = "推送XX消息到前台：推送频率是3秒一次", response = List.class, tags = {})
//    @Scheduled(fixedRate = 3000, initialDelay = 3000)
//    public void oneTopicPushMessage() {
//        List<Object> test = new ArrayList<>();
//        for (int i = 0; i < 100; i++) {
//            Map<String, String> data = new HashMap<>(16);
//            data.put("id", "1");
//            data.put("name", "test");
//            data.put("time", DateUtils.dateToString(new Date(), DateUtils.PATTERN));
//            test.add(data);
//        }
//        manager.send(Cmd.Warn, Topic.Aaa.toString(), test);
//    }
//
//    @ApiOperation(value = "推送XX消息到前台", notes = "推送XX消息到前台：推送频率是3秒一次", response = List.class, tags = {})
//    @Scheduled(fixedRate = 3000, initialDelay = 3000)
//    public void twoTopicPushMessage() {
//
//    }
//
//    @ApiOperation(value = "推送XX消息到前台", notes = "推送XX消息到前台：推送频率是3秒一次", response = List.class, tags = {})
//    @Scheduled(fixedRate = 3000, initialDelay = 3000)
//    public void threeTopicPushMessage() {
//
//    }
//}
